package org.hyl.javabase.泛型;

import org.junit.Test;

public class demo1 {
	@Test
	public  void main() {
		
//		Integer i = 100;
//		Integer j=new Integer(100);
//		int a=i.intValue();
//		a=i;
		Object []bb={9,"SD",2,352,2,2};
		System.out.println(bb[1]);
		zcl z=new zcl();
		zcl z1=new zcl();
		Container1 c10 = new Container1("pp", z);
		Container1 c11 = new Container1("qq", z1);
		Container1 c12 = new Container1(1.2, 3.2);
		System.out.println(c10.getKey() + " : " + c10.getValue());
		System.out.println(c11.getKey() + " : " + c11.getValue());
		System.out.println(c12.getKey() + " : " + c12.getValue());

		Container2<String, String> c1 = new Container2<String, String>("name", "自定义");
		Container2<String, Integer> c2 = new Container2<String, Integer>("age", 24);
		Container2<Object, Object> c3 = new Container2<>(1.1, 2.2);
		System.out.println(c1.getKey() + " : " + c1.getValue());
		System.out.println(c2.getKey() + " : " + c2.getValue());
		System.out.println(c3.getKey() + " : " + c3.getValue());
	}
}

class zcl{
	
	
}
class Container1 {
	private Object key;
	private Object value;

	public Object getKey() {
		return key;
	}

	public void setKey(Object key) {
		this.key = key;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public Container1(Object k, Object v) {
		key = k;
		value = v;
	}

}

class Container2<Z, V> {
	private Z key;
	private V value;

	
	public Container2(Z k, V v) {
		key = k;
		value = v;
	}

	public Z getKey() {
		return key;
	}

	public void setKey(Z key) {
		this.key = key;
	}

	public V getValue() {
		return value;
	}

	public void setValue(V value) {
		this.value = value;
	}
}
